๐ FlexyKey REST API โ Developer Integration Guide
Welcome to the FlexyKey REST API.
This API allows third-party developers to integrate booking systems, access control systems, and automation platforms with FlexyKey and Evva AirKey units.
The API provides:
- Unit control (F1/F2 and X1โX64)
- Full IO status monitoring
- Booking management
- Unit information
- Logs for FlexyKey
- And more depending on the unit type
This document explains how to authenticate, how to call the endpoints, and how to interpret responses.
๐ 1. Authentication & Access Control
The FlexyKey API uses HTTP Basic Authentication.
Your FlexyWeb username and password (API-enabled user) must be sent via the Authorization header:
Authorization: Basic base64(username:password)
Swagger and tools like Postman handle this automatically.
Access Requirement
All API calls are executed in the context of the authenticated user.
To use any API function (control, status, bookings, unit information), the user must belong to the same company that owns the target unit or booking object.
If a user does not have rights, the API returns an access error.
๐ 2. Base URL
Production
https://api.flexykey.se/v1/
Swagger documentation
https://api.flexykey.se/v1/swagger
โ๏ธ 3. Data Format
- JSON
- UTF-8 encoding
- ISO 8601 timestamps, always in UTC
Example:
2025-11-21T10:21:11Z
๐ง 4. Control API
The Control API allows developers to:
- Control relays (F1, F2) on main unit. F1 = Relay 1, F2 = Relay 2
- Control up to 64 extended outputs (X1โX64)
- Send ON / OFF / pulse commands
- Retrieve full IO status (inputs and outputs)
- Reference units by
unitId or serialNumber
๐ 4.1 Control Output
POST /Control
Send a control command to a FlexyKey unit.
URL:
https://api.flexykey.se/v1/Control
Request body (JSON)
Specify either unitId or serialNumber.
outputNumber can be F1, F2 or X1โX64.
outputAction can be ON, OFF or a pulse value in seconds, 1โ99999 (only number, no unit).
Example 1 โ Control F1 ON
{
"unitId": 3023,
"outputNumber": "F1",
"outputAction": "ON"
}
Example 2 โ Pulse X33 for 60 seconds
{
"serialNumber": "040530585131396",
"outputNumber": "X33",
"outputAction": "60"
}
Response:
{
"status": "OK",
"unitId": 3023,
"outputNumber": "F1",
"outputAction": "ON",
"messageId": null
}
๐ก 4.2 Get IO Status
GET /Control
Retrieve the current IO state of a unit.
By unitId:
https://api.flexykey.se/v1/Control?unitId=3023
By serial:
https://api.flexykey.se/v1/Control?serialNumber=040530585131396
Response example:
{
"unitId": 3023,
"serialNumber": "040530585131396",
"statusTimestamp": "2025-11-21 08:14:50",
"statusTimestampIso": "2025-11-21T08:14:50Z",
"rawStatus": "ASTAT:00----,10,--------------------------------0000--------------------00000000, T1=-- T2=-- T3=-- T7600=42",
"inputs": [
{ "input": "IN1", "state": "off" },
{ "input": "IN2", "state": "off" }
],
"fOutputs": [
{ "output": "F1", "state": "on" },
{ "output": "F2", "state": "off" }
],
"xOutputs": [
{ "output": "X33", "state": "off" },
{ "output": "X34", "state": "off" },
{ "output": "X35", "state": "off" },
{ "output": "X36", "state": "off" },
{ "output": "X57", "state": "off" },
{ "output": "X58", "state": "off" },
{ "output": "X59", "state": "off" },
{ "output": "X60", "state": "off" },
{ "output": "X61", "state": "off" },
{ "output": "X62", "state": "off" },
{ "output": "X63", "state": "off" },
{ "output": "X64", "state": "off" }
]
}
๐ 5. Booking API
The Booking API allows applications to:
- Create bookings
- Delete bookings
- Query bookings
- Assign phone, keypad code, or RFID credentials (depending on unit type)
Example โ Create a booking
{
"bookingObjectId": 123,
"startDate": "2025-11-21T09:00:00Z",
"endDate": "2025-11-21T10:00:00Z",
"phone1": "+46701234567"
}
Successful responses include a unique bookingId.
๐ฆ 6. Unit Information
Use the Unit endpoints to:
- Retrieve unit metadata
- View configuration
- List units assigned to bookingObjects
Example โ Get information about one specific unit
GET
https://api.flexykey.se/v1/units/5459
Response example
{
"unitId": 5459,
"unitType": "FlexyKey",
"serialnumber": "173717222150419",
"ownPhoneOrID": "07181008738825",
"name": "FKV3 test",
"softVersion": "09.14",
"unitInfo": "Maccess 09.14 Sn: 163717822150480 SIMCOMยงSIM7600E LE11B04SIM7600M21-A T=34 Rssi=30 ESP32-D0WD-V3 F:16 R:4 RssiW=-68 CN:WIFI Build Apr 15 2024 FKV3 Gate",
"unitNote": null,
"timezoneId": "W. Europe Standard Time",
"timezoneInfo": "(UTC+01:00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien)",
"created": "2022-07-06T13:10:14Z"
}
Example โ List all units
GET
https://api.flexykey.se/v1/units
Response example
[
{
"unitId": 2459,
"unitType": "FlexyKey",
"serialnumber": "163717822150484",
"ownPhoneOrID": "07181008778862",
"name": "FKV3 testenhet",
"softVersion": "09.14",
"unitInfo": "Maccess 09.14 Sn: 163717822150480 SIMCOMยงSIM7600E LE11B04SIM7600M21-A T=34 Rssi=30 ESP32-D0WD-V3 F:16 R:4 RssiW=-68 CN:WIFI Build Apr 15 2024 FKV3 Gate",
"unitNote": null,
"timezoneId": "W. Europe Standard Time",
"timezoneInfo": "(UTC+01:00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien)",
"created": "2022-07-06T13:10:14Z"
},
{
"unitId": 2466,
"unitType": "FlexyKey",
"serialnumber": "163717822150491",
"ownPhoneOrID": "07181008738862",
"name": "FKV3 testenhet 2",
"softVersion": "09.14",
"unitInfo": "Maccess 09.14 Sn: 163717822150496 ? ? T=0 Rssi=? ESP32-D0WD-V3 F:16 R:4 RssiW=-52 CN:WIFI Build May 30 2024 FKV3 Gate",
"unitNote": null,
"timezoneId": "W. Europe Standard Time",
"timezoneInfo": "(UTC+01:00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien)",
"created": "2022-09-06T11:24:27Z"
}
]
๐งพ 7. Logs
FlexyKey logs are available via API for:
- Access events
- System messages
- SMS events
- Communication logs
(Evva logs are not available.)
Example โ Retrieve logs for a unit
GET
https://api.flexykey.se/v1/unitlogs/3023?dateFrom=2025-11-18T07:00:00Z&dateTo=2025-11-27T16:00:00Z
Response example
[
{
"serverDate": "2025-11-26T19:18:54Z",
"unitDate": "2025-11-26T19:18:00Z",
"sourceID": "9000004321",
"sourceLabel": "Enskild kod larm pรฅ",
"actionLabel": "61",
"logMsg": "puls pรฅ X-utgรฅng via telefon/rfid/tangentbord"
},
{
"serverDate": "2025-11-26T19:19:44Z",
"unitDate": "2025-11-26T19:18:00Z",
"sourceID": "9000001234",
"sourceLabel": "- Saknas -",
"actionLabel": "-",
"logMsg": "numret finns inte registrerat"
},
{
"serverDate": "2025-11-27T07:49:46Z",
"unitDate": "2025-11-27T07:49:00Z",
"sourceID": "Informationslogg",
"sourceLabel": "--",
"actionLabel": "--",
"logMsg": "Omstart av programvara."
}
]
๐ฏ 8. Best Practices
- Always check HTTP status codes
- Use the ISO timestamp (
statusTimestampIso) for data storage
- Pulse commands (โ60โ) return to OFF when expired
- Do not poll status too frequently (recommended 5โ10 seconds)
- Do not poll status too long; in most cases 2โ5 status requests after a control command are sufficient.
- Treat X-outputs case-insensitively (โx33โ = โX33โ)
- Always use HTTPS
๐ 9. Support
FlexAccess AB
https://flexaccess.se
support@flexaccess.se
Please provide:
- Your API username
- Unit serial number
- Example request + response
- Approximate timestamp (UTC)